#include <iostream>
using namespace std;
class Complex {
private:
    double real;
    double imag;

public:
    Complex(double r = 0.0, double i = 0.0) : real(r), imag(i) {}

    Complex operator+(const Complex& c) {
        Complex temp;
        temp.real = real + c.real;
        temp.imag = imag + c.imag;
        return temp;
    }

    Complex& operator+=(const Complex& c) {
        real += c.real;
        imag += c.imag;
        return *this;
    }

    bool operator==(const Complex& c) {
        return (real == c.real) && (imag == c.imag);
    }

    double getReal() const {
        return real;
    }

    double getImag() const {
        return imag;
    }
};

int main() {
    Complex a(3.0, 4.0);
    Complex b(2.0, -1.0);

    Complex c = a + b;  
    std::cout << "a + b = " << c.getReal() << " + " << c.getImag() << "i" << endl;

    a += b;  
    cout << "a += b: " << a.getReal() << " + " << a.getImag() << "i" << endl;

    if (a == c) {  
        cout << "a and c are equal." << endl;
    } else {
        cout << "a and c are not equal." << endl;
    }

    return 0;
}
